{{csrf_field()}}
<div style="padding:30px 30px 30px 20px" class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">名称：</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{{$info->name ?? ''}}" id="name" required="" lay-verify="required"  lay-reqText="名称必填" placeholder="请输入名称" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">标识：</label>
        <div class="layui-input-block">
            <input type="text" name="slug" value="{{$info->slug ?? ''}}" id="slug" required="" lay-verify="required"  lay-reqText="标识必填" placeholder="请输入标识" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">权限：</label>
        <div class="layui-input-block">
            @if(isset($permissions))
                @foreach($permissions as $key =>$val)
                    <input type="checkbox" @if(isset($checkArr) && in_array($val['id'],$checkArr)) checked @endif name="permissions[]"  value="{{$val['id']}}"  title="{{$val['name']}}">
                @endforeach
            @endif

                <div id="test1" class="demo-transfer"></div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-fluid"  lay-submit lay-filter="popup-save" >保 存</button>
        </div>
    </div>
  </div>
<script>
    layui.use(['table','form','layer','transfer',  'util'], function(){
        var table = layui.table
            ,transfer = layui.transfer
            ,layer = layui.layer
            ,util = layui.util;


        //
        //模拟数据
        var data1 = [
            {"value": "1", "title": "李白"}
            ,{"value": "2", "title": "杜甫"}
            ,{"value": "3", "title": "苏轼"}
            ,{"value": "4", "title": "李清照"}
            ,{"value": "5", "title": "鲁迅", "disabled": true}
            ,{"value": "6", "title": "巴金"}
            ,{"value": "7", "title": "冰心"}
            ,{"value": "8", "title": "矛盾"}
            ,{"value": "9", "title": "贤心"}
        ]
        //基础效果
        transfer.render({
            elem: '#test1'
            ,title: ['所有权限', '当前权限']  //自定义标题
            ,showSearch: true
            ,data: data1
        })
        //
    });
</script>